//
//  CGQxieyicontentTableViewCell.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/5/12.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit



class CGQxieyicontentTableViewCell: SYBaseCell {
    
    var bgView: UIView = {
        let v = UIView()
        v.backgroundColor = .white
        v.layer.cornerRadius = 5.autoWidth()
        return v
    }()
 
    let tiplab: UILabel = {
        let v = UILabel()
        v.text = "光明渔业api数据解析"
        v.font = 15.autoBoldFontSize()
        v.textColor = UIColor(hex: 0x333333)
        return v
    }()
    var lView: UIView = {
        let v = UIView()
        v.backgroundColor = UIColor(hex: 0xF0F0F0)
        return v
    }()
    
    let imgView: UIImageView = {
        let v = UIImageView()
        v.image = UIImage(named: "xieyi_icon")
        return v
    }()
    
    
    
    
    let xiangmu: CGQlixianView = {
        let v = CGQlixianView()
        v.title.text = "协议编码："
        v.num.text = "龙吃鲫鱼"
        return v
    }()
    
    let shebei: CGQlixianView = {
        let v = CGQlixianView()
        v.title.text = "编码格式："
        v.num.text = "二氧化碳"
        return v
    }()
   
    
    public func configureView(model: NSxieyiRecordsModel){
        
        tiplab.text = model.protocolName
        xiangmu.num.text = model.protocolCode
        shebei.num.text = model.codeSystem
       
     
        
        
    }
    
    
    override func initViews() {
    
        addSubview(bgView)
        bgView.addSubview(imgView)
        bgView.addSubview(tiplab)
        bgView.addSubview(lView)
        bgView.addSubview(xiangmu)
        bgView.addSubview(shebei)
        
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(10.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(10))
            make.right.equalToSuperview().offset(autoWidth(-10))
            make.bottom.equalToSuperview()
        }
        imgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(10.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.width.height.equalTo(18.autoWidth())
        }
        tiplab.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(12.autoWidth())
            make.left.equalTo(imgView.snp.right).offset(autoWidth(6))
            make.right.equalToSuperview().offset(autoWidth(-12))
        }
        lView.snp.makeConstraints { (make) in
            make.top.equalTo(tiplab.snp.bottom).offset(12.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(0))
            make.right.equalToSuperview().offset(autoWidth(0))
            make.height.equalTo(0.5)
        }
        
        xiangmu.snp.makeConstraints { (make) in
            make.top.equalTo(lView.snp.bottom).offset(17.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(12))
            make.right.equalToSuperview().offset(autoWidth(-15))
        }
        shebei.snp.makeConstraints { (make) in
            make.top.equalTo(xiangmu.snp.bottom).offset(17.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(12))
            make.right.equalToSuperview().offset(autoWidth(-15))
            make.bottom.equalToSuperview().offset(autoWidth(-10))
        }
        
    }


}
